<?php
class HomeController extends AppController {
    // var $helpers = array ('Html','Form');
    //errore:var $name = 'Pages'; // riferimento alla cartella delle view
    
    public function beforeFilter(){
    	
		parent::beforeFilter();
        $this->Auth->allow('index');
		
		
    }
    
    public function index() {
    	if (!$this->Session->read('Auth.User')) {
    		$this->redirect("/Users/login");
    	} else {
	    	Controller::loadModel('Istituto');
			$this->Session->write('data', $this->Istituto->read(null,1));
			//prendo tutti i dati dell'istituto e li metto in Sessione
    	}
    }
	
	public function contact() {
		
	}
	
	public function abaut() {
		
	}
	
	public function home() {

	}
}
?>